home *** CD-ROM | disk | FTP | other *** search
- property UpCM, DownCM, button_active
-
- on getPropertyDescriptionList
- set description to [:]
- addProp(description, #DownCM, [#default: "Down", #format: #bitmap, #comment: "Pict for Down:"])
- return description
- end
-
- on getBehaviorDescription
- return "Button, auto set up pict, switch pict down"
- end
-
- on getAssocMembers
- set myPropList to [DownCM]
- return myPropList
- end
-
- on beginSprite me
- set the UpCM of me to the member of sprite the spriteNum of me
- set the button_active of me to 0
- puppetSprite(the spriteNum of me, 1)
- end
-
- on endSprite me
- puppetSprite(the spriteNum of me, 0)
- end
-
- on mouseDown me
- set the member of sprite the spriteNum of me to member the DownCM of me
- set the button_active of me to 1
- end
-
- on mouseUp me
- set the member of sprite the spriteNum of me to member the UpCM of me
- set the button_active of me to 0
- end
-
- on mouseUpOutSide me
- set the button_active of me to 0
- end
-
- on mouseLeave me
- if the button_active of me then
- set the member of sprite the spriteNum of me to member the UpCM of me
- end if
- end
-
- on mouseEnter me
- if the button_active of me then
- set the member of sprite the spriteNum of me to member the DownCM of me
- end if
- end
-